﻿<?xml version="1.0" encoding="utf-8" ?>
<Recipe Name="CreateSetupProject" xmlns="http://schemas.microsoft.com/pag/gax-core"
                               xmlns:xi="http://www.w3.org/2001/XInclude" Bound="true">
  <xi:include href="../Common/CommonTypeAliases.xml"
				xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Types)" />
  <Caption>Create a new Visual Studio Isolated Application setup</Caption>
  <Description>Create a new Visual Studio Isolated Application setup</Description>
  <Arguments>
    <xi:include href="../Common/CommonArguments.xml"
					  xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(/gax:Arguments/gax:Argument)" />
    <Argument Name="safeprojectname"/>
    <Argument Name="VSShellProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true"/>
    <Argument Name="SetupProject" Type="EnvDTE.Project, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider
        Type="VSSDKAssist.Assets.ValueProviders.VisualStudio.ProjectByPathExpressionProvider, VSSDKAssist.Assets"
        PathExpression="$(safeprojectname)"
        Stage="OnBeforeActions"/>
    </Argument>
    <Argument Name="FilesTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\Files.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="MainTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\Main.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="VariablesTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\Variables.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="RegistryTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\Registry.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="StringsTT" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="TT\common\CreateSetupProject\Strings.tt"
                     Stage="OnBeginRecipe"/>
    </Argument>
    <Argument Name="Manufacturer" Required="true"/>
    <Argument Name="ProductNameArgument" Required="true"/>
    <Argument Name="Description" Required="true"/>
    <Argument Name="Comments" Required="true"/>
    <Argument Name="DefFileProjectItem" Type="EnvDTE.ProjectItem, EnvDTE, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" Required="true">
      <ValueProvider
        Type="VSShellAssist.Recipes.Common.ValueProviders.PkgDefProjectItemValueProvider, VSShellAssist"
        VSShellProjectArgument="VSShellProject"
        Stage="OnBeforeActions">
        <MonitorArgument Name="VSShellProject"/>
      </ValueProvider>
    </Argument>
    <Argument Name="SKUName" Required="true">
      <ValueProvider Type="VSShellAssist.Recipes.Common.ValueProviders.DefFileKeyValueValueProvider, VSShellAssist"
               DefFileArgument="DefFileProjectItem"
               SectionName="$RootKey$"
               KeyName="AppName"
               Stage="OnBeforeActions">
      </ValueProvider>
    </Argument>
    <Argument Name="SKUGuid" Required="true">
      <ValueProvider Type="VSShellAssist.Recipes.Common.ValueProviders.DefFileKeyValueValueProvider, VSShellAssist"
               DefFileArgument="DefFileProjectItem"
               SectionName="$RootKey$"
               KeyName="ThisVersionDTECLSID"
               Stage="OnBeforeActions"/>
    </Argument>
    <Argument Name="VSShellProjectRelativePath" Required="true">
      <ValueProvider Type="Evaluator"
                     Expression="..\"
                     Stage="OnBeginRecipe">
      </ValueProvider>
    </Argument>  
  </Arguments>
  <GatheringServiceData>
    <Wizard xmlns="http://schemas.microsoft.com/pag/gax-wizards" SchemaVersion="1.0">
      <Pages>
        <Page Type="VSShellAssist.Recipes.CreateSetupProject.CreateSetupProjectCP, VSSHellAssist"
            Height="200" Width="510">
          <Title>Specify setup properties</Title>
          <LinkTitle>Setup properties</LinkTitle>
        </Page>
      </Pages>
    </Wizard>
  </GatheringServiceData>
  <Actions CoordinatorServiceType="VSShellAssist.Recipes.Common.Coordinators.ExecutionProgressCoordinator, VSShellAssist">
    <!--Compile project-->
    <Action Name="CompileProject"
          Type="VSSDKAssist.Assets.Actions.VisualStudio.CompileProjectAction, VSSDKAssist.Assets"
          StatusMessage="Compiling project"
          WriteMessageToOutputWindow="true">
      <Input Name="Project" RecipeArgument="VSShellProject"/>
    </Action>
    <!-- Add wxs fragments-->
    <Action Name="GenerateFilesWxs"
            Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library"
            StatusMessage="Creating wix fragments"
            WriteMessageToOutputWindow="true">
      <Input Name="Template" RecipeArgument="FilesTT"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddFilesWxs"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="Files.wxs"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GenerateFilesWxs.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction1"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionCompile">
      <Input Name="ProjectItem" ActionOutput="AddFilesWxs.ProjectItem"/>
    </Action>
    <Action Name="GenerateMainWxs"
        Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="MainTT"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddMainWxs"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="Main.wxs"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GenerateMainWxs.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction2"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionCompile">
      <Input Name="ProjectItem" ActionOutput="AddMainWxs.ProjectItem"/>
    </Action>
    <Action Name="GenerateRegistryWxs"
        Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="RegistryTT"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddRegistryWxs"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="Registry.wxs"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GenerateRegistryWxs.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction3"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionCompile">
      <Input Name="ProjectItem" ActionOutput="AddRegistryWxs.ProjectItem"/>
    </Action>
    <Action Name="GenerateStringsWxl"
        Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="StringsTT"/>
      <Input Name="Manufacturer" RecipeArgument="Manufacturer"/>
      <Input Name="ProductName" RecipeArgument="ProductNameArgument"/>
      <Input Name="Description" RecipeArgument="Description"/>
      <Input Name="Comments" RecipeArgument="Comments"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddStringsWxl"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="Strings.wxl"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GenerateStringsWxl.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction4"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionContent">
      <Input Name="ProjectItem" ActionOutput="AddStringsWxl.ProjectItem"/>
    </Action>
    <Action Name="GenerateVariablesWxi"
      Type="Microsoft.Practices.RecipeFramework.VisualStudio.Library.Templates.TextTemplateAction, Microsoft.Practices.RecipeFramework.VisualStudio.Library">
      <Input Name="Template" RecipeArgument="VariablesTT"/>
      <Input Name="SKUName" RecipeArgument="SKUName"/>
      <Input Name="SKUGuid" RecipeArgument="SKUGuid"/>
      <Input Name="VSShellProjectRelativePath" RecipeArgument="VSShellProjectRelativePath"/>
      <Output Name="Content" />
    </Action>
    <Action Name="AddVariablesWxi"
            Type="VSSDKAssist.Assets.Actions.VisualStudio.AddItemFromStringAction, VSSDKAssist.Assets"
            TargetFileName="Variables.wxi"
            Open="false">
      <Input Name="Project" RecipeArgument="SetupProject"/>
      <Input Name="Content" ActionOutput="GenerateVariablesWxi.Content"/>
      <Output Name="ProjectItem"/>
    </Action>
    <Action Name="SetBuildAction5"
        Type="VSSDKAssist.Assets.Actions.VisualStudio.SetProjectItemBuildAction, VSSDKAssist.Assets"
        BuildAction="prjBuildActionContent">
      <Input Name="ProjectItem" ActionOutput="AddVariablesWxi.ProjectItem"/>
    </Action>
    <!--<Action Name="AddReferenceToSetupProject" Type="VSSDKAssist.Assets.Actions.VisualStudio.VisualStudio.AddProjectReferenceAction ,VSSDKAssist.Assets">
      <Input Name="ReferringProject" RecipeArgument="SetupProject"/>
      <Input Name="ReferencedProject" RecipeArgument="VSShellProject"/>
    </Action>-->
  </Actions>
</Recipe>